package reno.activity.eo;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "activity", schema = "activity", catalog = "")
public class ActivityEntity {
    private long activityid;
    private String activityname;
    private String startcommand;
    private String continuecommand;
    private String pausecommand;
    private String stopcommand;
    private String joincommand;
    private String groupcardlimit;
    private Timestamp starttime;
    private Timestamp stoptime;
    private String manager;
    @Transient
    private boolean open;

    public boolean isOpen() {
        return open;
    }

    public void setOpen(boolean open) {
        this.open = open;
    }

    @Id
    @Column(name = "activityid")
    public long getActivityid() {
        return activityid;
    }

    public void setActivityid(long activityid) {
        this.activityid = activityid;
    }

    @Basic
    @Column(name = "activityname")
    public String getActivityname() {
        return activityname;
    }

    public void setActivityname(String activityname) {
        this.activityname = activityname;
    }

    @Basic
    @Column(name = "startcommand")
    public String getStartcommand() {
        return startcommand;
    }

    public void setStartcommand(String startcommand) {
        this.startcommand = startcommand;
    }

    @Basic
    @Column(name = "continuecommand")
    public String getContinuecommand() {
        return continuecommand;
    }

    public void setContinuecommand(String continuecommand) {
        this.continuecommand = continuecommand;
    }

    @Basic
    @Column(name = "pausecommand")
    public String getPausecommand() {
        return pausecommand;
    }

    public void setPausecommand(String pausecommand) {
        this.pausecommand = pausecommand;
    }

    @Basic
    @Column(name = "stopcommand")
    public String getStopcommand() {
        return stopcommand;
    }

    public void setStopcommand(String stopcommand) {
        this.stopcommand = stopcommand;
    }

    @Basic
    @Column(name = "joincommand")
    public String getJoincommand() {
        return joincommand;
    }

    public void setJoincommand(String joincommand) {
        this.joincommand = joincommand;
    }

    @Basic
    @Column(name = "groupcardlimit")
    public String getGroupcardlimit() {
        return groupcardlimit;
    }

    public void setGroupcardlimit(String groupcardlimit) {
        this.groupcardlimit = groupcardlimit;
    }

    @Basic
    @Column(name = "starttime")
    public Timestamp getStarttime() {
        return starttime;
    }

    public void setStarttime(Timestamp starttime) {
        this.starttime = starttime;
    }

    @Basic
    @Column(name = "stoptime")
    public Timestamp getStoptime() {
        return stoptime;
    }

    public void setStoptime(Timestamp stoptime) {
        this.stoptime = stoptime;
    }

    @Basic
    @Column(name = "manager")
    public String getManager() {
        return manager;
    }

    public void setManager(String manager) {
        this.manager = manager;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ActivityEntity that = (ActivityEntity) o;
        return activityid == that.activityid &&
                Objects.equals(activityname, that.activityname) &&
                Objects.equals(startcommand, that.startcommand) &&
                Objects.equals(stopcommand, that.stopcommand) &&
                Objects.equals(joincommand, that.joincommand) &&
                Objects.equals(groupcardlimit, that.groupcardlimit) &&
                Objects.equals(starttime, that.starttime) &&
                Objects.equals(stoptime, that.stoptime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(activityid, activityname, startcommand, stopcommand, joincommand, groupcardlimit, starttime, stoptime);
    }
}
